import Stages.GameStage
import com.badlogic.gdx.ApplicationAdapter
import com.badlogic.gdx.Gdx
import com.badlogic.gdx.backends.lwjgl.LwjglApplication
import com.badlogic.gdx.graphics.Color
import com.badlogic.gdx.graphics.g2d.TextureAtlas

fun main(args: Array<String>)
{
    LwjglApplication(MainPage(), config {
        width = 480
        height = 320
        useGL20 = true
        backgroundFPS = 30
        foregroundFPS = 120
        initialBackgroundColor = Color.GRAY
        resizable = false
        title = "TexturePackerDemo"
    })
}

class MainPage : ApplicationAdapter()
{
    private val textureAtlas by lazy {
        TextureAtlas(Gdx.files.internal("texture_pack.pack"))
    }
    private val gameStage by lazy { GameStage(textureAtlas) }

    override fun create()
    {
        Gdx.input.inputProcessor = gameStage
    }
    
    override fun render()
    {
        clear()
        gameStage.act()
        gameStage.draw()
    }
    
}


